#include <vector>
#include <string>
#include "Unit/ByteBuffer.h"

struct activity
{
	activity();

	int activityId;
	std::vector<byte> content;
	int remainder;

	enum {
		enum_activityId,
		enum_content,
		enum_remainder,
	};
};
CBuffer &operator<<(CBuffer &b, activity &s){ b<<s.activityId<<s.content<<s.remainder; return b;}
CBuffer &operator>>(CBuffer &b, activity &s){ b>>s.activityId>>s.content>>s.remainder; return b;}

struct banaccount
{
	banaccount();

	uint Id;
	uint roleId;

	enum {
		enum_Id,
		enum_roleId,
	};
};
CBuffer &operator<<(CBuffer &b, banaccount &s){ b<<s.Id<<s.roleId; return b;}
CBuffer &operator>>(CBuffer &b, banaccount &s){ b>>s.Id>>s.roleId; return b;}

struct banip
{
	banip();

	uint Id;
	std::string ip;

	enum {
		enum_Id,
		enum_ip,
	};
};
CBuffer &operator<<(CBuffer &b, banip &s){ b<<s.Id<<s.ip; return b;}
CBuffer &operator>>(CBuffer &b, banip &s){ b>>s.Id>>s.ip; return b;}

struct banspeak
{
	banspeak();

	uint Id;
	uint roleId;
	uint enableTime;

	enum {
		enum_Id,
		enum_roleId,
		enum_enableTime,
	};
};
CBuffer &operator<<(CBuffer &b, banspeak &s){ b<<s.Id<<s.roleId<<s.enableTime; return b;}
CBuffer &operator>>(CBuffer &b, banspeak &s){ b>>s.Id>>s.roleId>>s.enableTime; return b;}

struct gangtable
{
	gangtable();

	int id;
	std::string gangName;
	std::vector<byte> logData;
	std::vector<byte> applyData;
	std::vector<byte> memData;
	std::vector<byte> gangData;

	enum {
		enum_id,
		enum_gangName,
		enum_logData,
		enum_applyData,
		enum_memData,
		enum_gangData,
	};
};
CBuffer &operator<<(CBuffer &b, gangtable &s){ b<<s.id<<s.gangName<<s.logData<<s.applyData<<s.memData<<s.gangData; return b;}
CBuffer &operator>>(CBuffer &b, gangtable &s){ b>>s.id>>s.gangName>>s.logData>>s.applyData>>s.memData>>s.gangData; return b;}

struct globaldata
{
	globaldata();

	int globalId;
	std::vector<byte> globalValue;

	enum {
		enum_globalId,
		enum_globalValue,
	};
};
CBuffer &operator<<(CBuffer &b, globaldata &s){ b<<s.globalId<<s.globalValue; return b;}
CBuffer &operator>>(CBuffer &b, globaldata &s){ b>>s.globalId>>s.globalValue; return b;}

struct hsqj_log
{
	hsqj_log();

	uint Id;
	int playerId;
	int type;
	int recordTime;
	int value1;
	int value2;
	int value3;
	int value4;
	int value5;
	int value6;
	int value7;
	int value8;
	int value9;
	int value10;

	enum {
		enum_Id,
		enum_playerId,
		enum_type,
		enum_recordTime,
		enum_value1,
		enum_value2,
		enum_value3,
		enum_value4,
		enum_value5,
		enum_value6,
		enum_value7,
		enum_value8,
		enum_value9,
		enum_value10,
	};
};
CBuffer &operator<<(CBuffer &b, hsqj_log &s){ b<<s.Id<<s.playerId<<s.type<<s.recordTime<<s.value1<<s.value2<<s.value3<<s.value4<<s.value5<<s.value6<<s.value7<<s.value8<<s.value9<<s.value10; return b;}
CBuffer &operator>>(CBuffer &b, hsqj_log &s){ b>>s.Id>>s.playerId>>s.type>>s.recordTime>>s.value1>>s.value2>>s.value3>>s.value4>>s.value5>>s.value6>>s.value7>>s.value8>>s.value9>>s.value10; return b;}

struct hsqj_log_20140212
{
	hsqj_log_20140212();

	uint Id;
	int playerId;
	int type;
	int recordTime;
	int value1;
	int value2;
	int value3;
	int value4;
	int value5;
	int value6;
	int value7;
	int value8;
	int value9;
	int value10;

	enum {
		enum_Id,
		enum_playerId,
		enum_type,
		enum_recordTime,
		enum_value1,
		enum_value2,
		enum_value3,
		enum_value4,
		enum_value5,
		enum_value6,
		enum_value7,
		enum_value8,
		enum_value9,
		enum_value10,
	};
};
CBuffer &operator<<(CBuffer &b, hsqj_log_20140212 &s){ b<<s.Id<<s.playerId<<s.type<<s.recordTime<<s.value1<<s.value2<<s.value3<<s.value4<<s.value5<<s.value6<<s.value7<<s.value8<<s.value9<<s.value10; return b;}
CBuffer &operator>>(CBuffer &b, hsqj_log_20140212 &s){ b>>s.Id>>s.playerId>>s.type>>s.recordTime>>s.value1>>s.value2>>s.value3>>s.value4>>s.value5>>s.value6>>s.value7>>s.value8>>s.value9>>s.value10; return b;}

struct legion
{
	legion();

	int id;
	uint legionHeadId;
	uint createTime;
	uint disbandTime;
	uint firstDeputyHeaderId;
	uint secondDeputyHeaderId;
	uint countryId;
	uint level;
	std::string legionName;
	std::vector<byte> legionDataInfo;
	uint createrId;

	enum {
		enum_id,
		enum_legionHeadId,
		enum_createTime,
		enum_disbandTime,
		enum_firstDeputyHeaderId,
		enum_secondDeputyHeaderId,
		enum_countryId,
		enum_level,
		enum_legionName,
		enum_legionDataInfo,
		enum_createrId,
	};
};
CBuffer &operator<<(CBuffer &b, legion &s){ b<<s.id<<s.legionHeadId<<s.createTime<<s.disbandTime<<s.firstDeputyHeaderId<<s.secondDeputyHeaderId<<s.countryId<<s.level<<s.legionName<<s.legionDataInfo<<s.createrId; return b;}
CBuffer &operator>>(CBuffer &b, legion &s){ b>>s.id>>s.legionHeadId>>s.createTime>>s.disbandTime>>s.firstDeputyHeaderId>>s.secondDeputyHeaderId>>s.countryId>>s.level>>s.legionName>>s.legionDataInfo>>s.createrId; return b;}

struct mail
{
	mail();

	int playerId;
	int mailNum;
	std::vector<byte> mailContent;

	enum {
		enum_playerId,
		enum_mailNum,
		enum_mailContent,
	};
};
CBuffer &operator<<(CBuffer &b, mail &s){ b<<s.playerId<<s.mailNum<<s.mailContent; return b;}
CBuffer &operator>>(CBuffer &b, mail &s){ b>>s.playerId>>s.mailNum>>s.mailContent; return b;}

struct mailtable
{
	mailtable();

	uint Id;
	int playerId;
	int type;
	byte level;
	byte state;
	int sendTime;
	std::vector<byte> keyInfo;
	int serverId;

	enum {
		enum_Id,
		enum_playerId,
		enum_type,
		enum_level,
		enum_state,
		enum_sendTime,
		enum_keyInfo,
		enum_serverId,
	};
};
CBuffer &operator<<(CBuffer &b, mailtable &s){ b<<s.Id<<s.playerId<<s.type<<s.level<<s.state<<s.sendTime<<s.keyInfo<<s.serverId; return b;}
CBuffer &operator>>(CBuffer &b, mailtable &s){ b>>s.Id>>s.playerId>>s.type>>s.level>>s.state>>s.sendTime>>s.keyInfo>>s.serverId; return b;}

struct playerlogtable
{
	playerlogtable();

	uint Id;
	int playerId;
	int type;
	std::string roleName;
	int serverId;
	int recordTime;
	int value1;
	int value2;
	int value3;
	int value4;
	int value5;

	enum {
		enum_Id,
		enum_playerId,
		enum_type,
		enum_roleName,
		enum_serverId,
		enum_recordTime,
		enum_value1,
		enum_value2,
		enum_value3,
		enum_value4,
		enum_value5,
	};
};
CBuffer &operator<<(CBuffer &b, playerlogtable &s){ b<<s.Id<<s.playerId<<s.type<<s.roleName<<s.serverId<<s.recordTime<<s.value1<<s.value2<<s.value3<<s.value4<<s.value5; return b;}
CBuffer &operator>>(CBuffer &b, playerlogtable &s){ b>>s.Id>>s.playerId>>s.type>>s.roleName>>s.serverId>>s.recordTime>>s.value1>>s.value2>>s.value3>>s.value4>>s.value5; return b;}

struct rankdatatable
{
	rankdatatable();

	uint logTime;
	std::vector<byte> levelRank;
	std::vector<byte> zhandouliRank;
	std::vector<byte> arenaRank;
	std::vector<byte> gangRank;

	enum {
		enum_logTime,
		enum_levelRank,
		enum_zhandouliRank,
		enum_arenaRank,
		enum_gangRank,
	};
};
CBuffer &operator<<(CBuffer &b, rankdatatable &s){ b<<s.logTime<<s.levelRank<<s.zhandouliRank<<s.arenaRank<<s.gangRank; return b;}
CBuffer &operator>>(CBuffer &b, rankdatatable &s){ b>>s.logTime>>s.levelRank>>s.zhandouliRank>>s.arenaRank>>s.gangRank; return b;}

struct roletable
{
	roletable();

	int roleId;
	std::string roleName;
	int serverId;
	byte status;
	int createTime;
	int level;
	int viplevel;
	int zhandouli;
	std::vector<byte> roleData;
	int yuanbao;
	int quyu;
	int tongqian;
	int jungong;
	byte isYellowVip;
	byte isYellowYearVip;
	byte yellowVipLevel;

	enum {
		enum_roleId,
		enum_roleName,
		enum_serverId,
		enum_status,
		enum_createTime,
		enum_level,
		enum_viplevel,
		enum_zhandouli,
		enum_roleData,
		enum_yuanbao,
		enum_quyu,
		enum_tongqian,
		enum_jungong,
		enum_isYellowVip,
		enum_isYellowYearVip,
		enum_yellowVipLevel,
	};
};
CBuffer &operator<<(CBuffer &b, roletable &s){ b<<s.roleId<<s.roleName<<s.serverId<<s.status<<s.createTime<<s.level<<s.viplevel<<s.zhandouli<<s.roleData<<s.yuanbao<<s.quyu<<s.tongqian<<s.jungong<<s.isYellowVip<<s.isYellowYearVip<<s.yellowVipLevel; return b;}
CBuffer &operator>>(CBuffer &b, roletable &s){ b>>s.roleId>>s.roleName>>s.serverId>>s.status>>s.createTime>>s.level>>s.viplevel>>s.zhandouli>>s.roleData>>s.yuanbao>>s.quyu>>s.tongqian>>s.jungong>>s.isYellowVip>>s.isYellowYearVip>>s.yellowVipLevel; return b;}

struct serverdatatable
{
	serverdatatable();

	int id;
	int value1;
	int value2;
	int value3;
	std::vector<byte> data;

	enum {
		enum_id,
		enum_value1,
		enum_value2,
		enum_value3,
		enum_data,
	};
};
CBuffer &operator<<(CBuffer &b, serverdatatable &s){ b<<s.id<<s.value1<<s.value2<<s.value3<<s.data; return b;}
CBuffer &operator>>(CBuffer &b, serverdatatable &s){ b>>s.id>>s.value1>>s.value2>>s.value3>>s.data; return b;}

